<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/><meta name="theme-color" content="#3b3e43"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="format-detection" content="telephone=no"/><title>定制CAS登录验证 - D 的个人博客</title><meta name="description" content="定制 CAS 登录验证 转载请保留作者信息： 作者：88250 Blog：http:blog.csdn.netDL88250 MSN Gmail QQ：DL88250@gmail.com  1	目录
 2
 3摘要	1
 4环境	1
 5新建工程	1
 6添加依赖包	2
 7编写测试用例	2
 8编写实现代码	3
 9工程结构截图	5
10测试与打包	5
11启用定制后的登录验证	6
12整合测试	7
13总结	7
 摘要 本文以 Liferay 与 CAS 整合为例，将 CAS 登录验证从输入相同的用户名密码定制为以 Liferay 的用户身份进行验证。 环境 My...."/><meta property="og:description" content="定制 CAS 登录验证 转载请保留作者信息： 作者：88250 Blog：http:blog.csdn.netDL88250 MSN Gmail QQ：DL88250@gmail.com  1	目录
 2
 3摘要	1
 4环境	1
 5新建工程	1
 6添加依赖包	2
 7编写测试用例	2
 8编写实现代码	3
 9工程结构截图	5
10测试与打包	5
11启用定制后的登录验证	6
12整合测试	7
13总结	7
 摘要 本文以 Liferay 与 CAS 整合为例，将 CAS 登录验证从输入相同的用户名密码定制为以 Liferay 的用户身份进行验证。 环境 My...."/>    <meta name="keywords" content="88250"/><link rel="dns-prefetch" href="https://cdn.jsdelivr.net/gh/88250/solo@4.2.0/src/main/resources"/><link rel="dns-prefetch" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="https://cdn.jsdelivr.net/gh/88250/solo@4.2.0/src/main/resources"><link rel="icon" type="image/png" href="https://img.hacpai.com/avatar/1353745196354_1584267806213.jpeg?imageView2/1/w/256/h/256/interlace/0/q/100"/><link rel="apple-touch-icon" href="https://img.hacpai.com/avatar/1353745196354_1584267806213.jpeg?imageView2/1/w/256/h/256/interlace/0/q/100"><link rel="shortcut icon" type="image/x-icon" href="https://img.hacpai.com/avatar/1353745196354_1584267806213.jpeg?imageView2/1/w/256/h/256/interlace/0/q/100"><meta name="copyright" content="B3log"/><meta http-equiv="Window-target" content="_top"/><meta property="og:locale" content="zh_CN"/><meta property="og:title" content="定制CAS登录验证 - D 的个人博客"/><meta property="og:site_name" content="D 的个人博客"/><meta property="og:url"      content="https://dl88250.gitee.io/articles/2008/08/26/1219750620000.html?"/><meta property="og:image" content="https://img.hacpai.com/avatar/1353745196354_1584267806213.jpeg?imageView2/1/w/256/h/256/interlace/0/q/100"/><link rel="search" type="application/opensearchdescription+xml" title="定制CAS登录验证 - D 的个人博客" href="/opensearch.xml"><link href="https://dl88250.gitee.io/rss.xml" title="RSS" type="application/rss+xml" rel="alternate"/><link rel="manifest" href="https://dl88250.gitee.io/manifest.json">        <link rel="canonical" href="https://dl88250.gitee.io/articles/2008/08/26/1219750620000.html">        <link rel="stylesheet"
              href="https://cdn.jsdelivr.net/gh/88250/solo@4.2.0/src/main/resources/skins/Bubble/css/base.css?1593357893538"/>
            <link rel="prev" title="Liferay 5.1.1 安装与整合CAS" href="https://dl88250.gitee.io/articles/2008/08/20/1219250340000.html">
            <link rel="next" title="NetBeans 10th Birthday" href="https://dl88250.gitee.io/articles/2008/10/20/1224545820000.html">
    <script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?cf42ff23d16b7774f35a38218377e8a0";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<body class="fn__flex-column">
<div id="pjax" class="fn__flex-1">
    
    <progress class="fn__progress"></progress>
    <header class="header header--article">
        <div class="wrapper header__title">
            <h1 class="header__h1 fn__flex-inline">
                <a href="https://dl88250.gitee.io" rel="start">D 的个人博客</a>
            </h1>
            <h2 class="header__desc header__desc--title">全职做开源，自由职业者</h2>
            <div class="header__desc">
                
            </div>
            <svg class="header__down" id="headerDown" viewBox="0 0 32 32" width="100%" height="100%">
                <path d="M15.992 25.304c-0 0-0 0-0.001 0-0.516 0-0.981-0.216-1.31-0.563l-0.001-0.001-14.187-14.996c-0.306-0.323-0.494-0.76-0.494-1.241 0-0.998 0.809-1.807 1.807-1.807 0.517 0 0.983 0.217 1.313 0.565l0.001 0.001 12.875 13.612 12.886-13.612c0.331-0.348 0.797-0.565 1.314-0.565 0.481 0 0.918 0.187 1.242 0.493l-0.001-0.001c0.723 0.687 0.755 1.832 0.072 2.555l-14.201 14.996c-0.33 0.348-0.795 0.564-1.311 0.564-0.001 0-0.003 0-0.004 0h0z"></path>
            </svg>
        </div>
    </header>
    <div class="side__menu">
        <svg viewBox="0 0 32 32" width="100%" height="100%">
            <path d="M30 18h-28c-1.1 0-2-0.9-2-2s0.9-2 2-2h28c1.1 0 2 0.9 2 2s-0.9 2-2 2zM30 6.25h-28c-1.1 0-2-0.9-2-2s0.9-2 2-2h28c1.1 0 2 0.9 2 2s-0.9 2-2 2zM2 25.75h28c1.1 0 2 0.9 2 2s-0.9 2-2 2h-28c-1.1 0-2-0.9-2-2s0.9-2 2-2z"></path>
        </svg>
        <span>
            &nbsp; menu
        </span>
    </div>
    <div class="side__main">
        <div class="side__bg"></div>
        <div class="side__panel">
            <svg class="side__close ft__a" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20"
                 viewBox="0 0 20 20">
                <path d="M18.362 19.324c-0.902 0.902-2.363 0.902-3.263 0l-5.098-5.827-5.098 5.825c-0.902 0.902-2.363 0.902-3.263 0-0.902-0.902-0.902-2.363 0-3.263l5.304-6.057-5.306-6.061c-0.902-0.902-0.902-2.361 0-3.263s2.361-0.902 3.263 0l5.1 5.829 5.098-5.829c0.902-0.902 2.361-0.902 3.263 0s0.902 2.363 0 3.263l-5.304 6.061 5.304 6.057c0.902 0.902 0.902 2.363 0 3.265z"></path>
            </svg>

            <div class="side__header">
                <a href="https://dl88250.gitee.io" rel="start"><img class="side__logo" alt="D 的个人博客" src="https://img.hacpai.com/avatar/1353745196354_1584267806213.jpeg?imageView2/1/w/128/h/128/interlace/0/q/100"></a>

                <div class="side__meta">
                    413 文章 <br>
                    <span data-uvstaturl="https://dl88250.gitee.io">3446695</span> 浏览
                    
                </div>
            </div>

            <div class="side__title">
                <span>ღゝ◡╹)ノ❤️</span>
            </div>
            <ul class="side__nav">
                <li>
                    <a href="https://dl88250.gitee.io" rel="start">
                            D 的个人博客
                    </a>
                </li>
                    <li>
                        <a href="/about" target="_self"><img
                                class="page-icon" src="https://static.hacpai.com/images/tags/react.png" alt="关于我">关于我</a>
                    </li>
                    <li>
                        <a href="/my-github-repos" target="_self"><img
                                class="page-icon" src="/images/github-icon.png" alt="我的开源">我的开源</a>
                    </li>
                    <li>
                        <a href="https://hacpai.com" target="_blank"><img
                                class="page-icon" src="https://static.hacpai.com/images/favicon.png" alt="黑客派">黑客派</a>
                    </li>
                    <li>
                        <a href="https://b3log.org" target="_blank"><img
                                class="page-icon" src="https://static.b3log.org/images/brand/b3log-32.png" alt="B3log">B3log</a>
                    </li>
                <li>
                    <a href="https://dl88250.gitee.io/categories.html">分类</a>
                </li>
                <li>
                    <a href="https://dl88250.gitee.io/tags.html">标签墙</a>
                </li>
                <li>
                    <a href="https://dl88250.gitee.io/archives.html">存档</a>
                </li>
                <li>
                    <a href="https://dl88250.gitee.io/links.html">友情链接</a>
                </li>
                <li>
                    <a rel="alternate" href="https://dl88250.gitee.io/rss.xml">RSS</a>
                </li>
            </ul>
        </div>
    </div>
    <div class="article__top" style="background-image: url(https://img.hacpai.com/bing/20180909.jpg?imageView2/1/w/1280/h/720/interlace/1/q/100)">
        <div style="background-image: url(https://img.hacpai.com/bing/20180909.jpg?imageView2/1/w/1280/h/720/interlace/1/q/100)"></div>
        <canvas id="articleTop"></canvas>
    </div>
    <div class="article">
        <div class="ft__center">
            <div class="article__meta">
                <time>
                    2008-08-27
                </time>
                /
                    <a rel="tag"
                       href="https://dl88250.gitee.io/tags/Network%20Engineering">Network Engineering</a> &nbsp;
                    <a rel="tag"
                       href="https://dl88250.gitee.io/tags/Open%20Source">Open Source</a> &nbsp;
                    <a rel="tag"
                       href="https://dl88250.gitee.io/tags/Portal%20%26amp%3B%20Portlet">Portal &amp; Portlet</a> &nbsp;
                    <a rel="tag"
                       href="https://dl88250.gitee.io/tags/J2EE%2FJavaEE">J2EE/JavaEE</a> &nbsp;
            </div>
            <h2 class="article__title">
                定制CAS登录验证
            </h2>
<div class="article__share"
     data-title="定制CAS登录验证"
     data-blogtitle="D 的个人博客"
     data-url="https://dl88250.gitee.io/articles/2008/08/26/1219750620000.html"
     data-avatar="https://img.hacpai.com/avatar/1353745196354_1584267806213.jpeg?imageView2/1/w/128/h/128/interlace/0/q/100">
    <span class="item" data-type="qqz">
        <svg viewBox="0 0 32 32" width="100%" height="100%">
            <path d="M22.824 13.989l-8.348 6.287s3.351 0.522 8.404 0.461l-0.23-1.040 7.2-6.549c0.132-0.12 0.183-0.312 0.129-0.487s-0.203-0.299-0.377-0.314l-9.492-0.856-3.708-9.213c-0.068-0.169-0.226-0.279-0.401-0.279s-0.333 0.11-0.401 0.279l-3.708 9.213-9.492 0.856c-0.174 0.015-0.323 0.139-0.377 0.314s-0.004 0.366 0.129 0.487l7.2 6.549-2.158 9.742c-0.040 0.178 0.026 0.365 0.168 0.474 0.142 0.107 0.331 0.115 0.481 0.021l8.158-5.165 8.158 5.165c0.070 0.045 0.147 0.066 0.225 0.066 0.090 0 0.18-0.029 0.256-0.086 0.142-0.109 0.208-0.295 0.168-0.474l-1.707-7.704c0.732-0.386 1.538-1.040 1.538-1.040s-3.195 1.638-14.664 0.838l8.312-6.325s-0.327-0.534-10.744-0.914c-0.697-0.026 8.493-1.83 15.281-0.305z"></path>
        </svg>
    </span>
    <span class="item" data-type="wechat">
        <svg viewBox="0 0 32 32" width="100%" height="100%">
            <path d="M9.062 9.203c0-0.859-0.562-1.422-1.422-1.422-0.844 0-1.703 0.562-1.703 1.422 0 0.844 0.859 1.406 1.703 1.406 0.859 0 1.422-0.562 1.422-1.406zM20.672 17.125c0-0.562-0.562-1.125-1.422-1.125-0.562 0-1.125 0.562-1.125 1.125 0 0.578 0.562 1.141 1.125 1.141 0.859 0 1.422-0.562 1.422-1.141zM16.984 9.203c0-0.859-0.562-1.422-1.406-1.422-0.859 0-1.703 0.562-1.703 1.422 0 0.844 0.844 1.406 1.703 1.406 0.844 0 1.406-0.562 1.406-1.406zM26.906 17.125c0-0.562-0.578-1.125-1.422-1.125-0.562 0-1.125 0.562-1.125 1.125 0 0.578 0.562 1.141 1.125 1.141 0.844 0 1.422-0.562 1.422-1.141zM22.75 10.922c-0.359-0.047-0.719-0.063-1.094-0.063-5.375 0-9.625 4.016-9.625 8.953 0 0.828 0.125 1.625 0.359 2.375-0.359 0.031-0.703 0.047-1.063 0.047-1.422 0-2.547-0.281-3.969-0.562l-3.953 1.984 1.125-3.406c-2.828-1.984-4.531-4.547-4.531-7.656 0-5.391 5.094-9.625 11.328-9.625 5.563 0 10.453 3.391 11.422 7.953zM32 19.687c0 2.547-1.688 4.813-3.969 6.516l0.859 2.828-3.109-1.703c-1.141 0.281-2.281 0.578-3.406 0.578-5.391 0-9.625-3.688-9.625-8.219s4.234-8.219 9.625-8.219c5.094 0 9.625 3.688 9.625 8.219z"></path>
        </svg>
    </span>
    <span class="item" data-type="weibo">
        <svg viewBox="0 0 32 32" width="100%" height="100%">
            <path d="M13.444 27.064c-5.3 0.525-9.875-1.875-10.219-5.35-0.344-3.481 3.675-6.719 8.969-7.244 5.3-0.525 9.875 1.875 10.212 5.35 0.35 3.481-3.669 6.725-8.963 7.244zM24.038 15.521c-0.45-0.137-0.762-0.225-0.525-0.819 0.512-1.287 0.563-2.394 0.006-3.188-1.038-1.481-3.881-1.406-7.137-0.037 0 0-1.025 0.444-0.762-0.363 0.5-1.613 0.425-2.956-0.356-3.737-1.769-1.769-6.469 0.069-10.5 4.1-3.013 3.006-4.763 6.212-4.763 8.981 0 5.287 6.787 8.506 13.425 8.506 8.7 0 14.494-5.056 14.494-9.069 0-2.431-2.044-3.806-3.881-4.375z"></path>
            <path d="M29.819 5.833c-2.1-2.331-5.2-3.219-8.063-2.612v0c-0.663 0.144-1.081 0.794-0.938 1.45 0.144 0.662 0.788 1.081 1.45 0.938 2.038-0.431 4.238 0.2 5.731 1.856s1.9 3.913 1.256 5.888v0c-0.206 0.644 0.144 1.331 0.788 1.544 0.644 0.206 1.331-0.144 1.544-0.787v-0.006c0.9-2.762 0.331-5.938-1.769-8.269z"></path>
            <path d="M26.588 8.752c-1.025-1.138-2.538-1.569-3.925-1.269-0.569 0.119-0.931 0.688-0.813 1.256 0.125 0.569 0.688 0.931 1.25 0.806v0c0.681-0.144 1.419 0.069 1.919 0.619 0.5 0.556 0.637 1.313 0.419 1.975v0c-0.175 0.55 0.125 1.15 0.681 1.331 0.556 0.175 1.15-0.125 1.331-0.681 0.438-1.356 0.163-2.906-0.863-4.037z"></path>
            <path d="M13.738 20.771c-0.188 0.319-0.594 0.469-0.912 0.337-0.319-0.125-0.412-0.488-0.231-0.794 0.188-0.306 0.581-0.456 0.894-0.337 0.313 0.113 0.425 0.469 0.25 0.794zM12.044 22.933c-0.512 0.819-1.613 1.175-2.438 0.8-0.813-0.369-1.056-1.319-0.544-2.119 0.506-0.794 1.569-1.15 2.388-0.806 0.831 0.356 1.1 1.3 0.594 2.125zM13.969 17.146c-2.519-0.656-5.369 0.6-6.463 2.819-1.119 2.262-0.037 4.781 2.506 5.606 2.638 0.85 5.75-0.456 6.831-2.894 1.069-2.394-0.262-4.85-2.875-5.531z"></path>
        </svg>
    </span>
    <span class="item" data-type="twitter">
        <svg viewBox="0 0 32 32" width="100%" height="100%">
            <path d="M32.003 6.075c-1.175 0.525-2.444 0.875-3.769 1.031 1.356-0.813 2.394-2.1 2.887-3.631-1.269 0.75-2.675 1.3-4.169 1.594-1.2-1.275-2.906-2.069-4.794-2.069-3.625 0-6.563 2.938-6.563 6.563 0 0.512 0.056 1.012 0.169 1.494-5.456-0.275-10.294-2.888-13.531-6.862-0.563 0.969-0.887 2.1-0.887 3.3 0 2.275 1.156 4.287 2.919 5.463-1.075-0.031-2.087-0.331-2.975-0.819 0 0.025 0 0.056 0 0.081 0 3.181 2.263 5.838 5.269 6.437-0.55 0.15-1.131 0.231-1.731 0.231-0.425 0-0.831-0.044-1.237-0.119 0.838 2.606 3.263 4.506 6.131 4.563-2.25 1.762-5.075 2.813-8.156 2.813-0.531 0-1.050-0.031-1.569-0.094 2.913 1.869 6.362 2.95 10.069 2.95 12.075 0 18.681-10.006 18.681-18.681 0-0.287-0.006-0.569-0.019-0.85 1.281-0.919 2.394-2.075 3.275-3.394z"></path>
        </svg>
    </span>
    <span class="item__qr"></span>
</div>        </div>
        <div class="wrapper">
            <section class="vditor-reset articles article__content">
                <p style="margin-top: 0.17in; page-break-after: avoid; font-size: 20pt;" align="center"><font face="DejaVu Sans"><font size="4"><font face="DejaVu Sans"></font></font></font>
</p><pre><code class="highlight-chroma"><span class="highlight-ln">1</span>&lt;meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"&gt;
<span class="highlight-ln">2</span>&lt;title&gt;&lt;/title&gt;
<span class="highlight-ln">3</span>&lt;meta name="GENERATOR" content="OpenOffice.org 2.4  (Linux)"&gt;
<span class="highlight-ln">4</span>&lt;style type="text/css"&gt;
<span class="highlight-ln">5</span>&lt;!--
<span class="highlight-ln">6</span>	@page { size: 8.5in 11in; margin: 0.79in }
<span class="highlight-ln">7</span>	P { margin-bottom: 0.08in }
<span class="highlight-ln">8</span>--&gt;
<span class="highlight-ln">9</span>&lt;/style&gt;
</code></pre>
<p></p><p style="margin-top: 0.17in; page-break-after: avoid;" align="center"><font face="DejaVu Sans"><font style="font-size: 20pt;" size="5"><font face="DejaVu Sans">定制</font></font></font><font face="Nimbus Sans L, sans-serif"><font style="font-size: 20pt;" size="5">CAS</font></font><font face="DejaVu Sans"><font style="font-size: 20pt;" size="5"><font face="DejaVu Sans">登录验证</font></font></font></p>
<p><font face="Microsoft YaHei">转载请保留作者信息：</font></p>
<p><font face="DejaVu Sans"><font face="Microsoft YaHei">作者：</font></font><font face="Microsoft YaHei">88250</font></p>
<p><font face="Microsoft YaHei">Blog</font><font face="DejaVu Sans"><font face="Microsoft YaHei">：</font></font><a href="http://blog.csdn.net/DL88250" target="_blank"><font color="#2300dc"><font face="Microsoft YaHei">http:/blog.csdn.net/DL88250</font></font></a></p>
<p><font face="Microsoft YaHei">MSN &amp; Gmail &amp;
QQ</font><font face="DejaVu Sans"><font face="Microsoft YaHei">：</font></font><a href="mailto:DL88250@gmail.com" target="_blank"><font face="Microsoft YaHei">DL88250@gmail.com</font></a></p>
<div id="Table of Contents1" dir="ltr">
	<div id="Table of Contents1_Head" dir="ltr">
		<p style="margin-top: 0.17in; page-break-after: avoid;"><font face="DejaVu Sans"><font style="font-size: 16pt;" size="4"><b>目录</b></font></font></p>
	</div>
	<p style="margin-left: 0.2in; margin-bottom: 0in;"><font face="DejaVu Sans"><font size="3">摘要</font></font><font size="4">	1</font></p>
	<p style="margin-left: 0.39in; margin-bottom: 0in;"><font face="DejaVu Sans"><font size="3">环境</font></font>	1</p>
	<p style="margin-left: 0.39in; margin-bottom: 0in;"><font face="DejaVu Sans"><font size="3">新建工程</font></font>	1</p>
	<p style="margin-left: 0.39in; margin-bottom: 0in;"><font face="DejaVu Sans"><font size="3">添加依赖包</font></font>	2</p>
	<p style="margin-left: 0.39in; margin-bottom: 0in;"><font face="DejaVu Sans"><font size="3">编写测试用例</font></font>	2</p>
	<p style="margin-left: 0.39in; margin-bottom: 0in;"><font face="DejaVu Sans"><font size="3">编写实现代码</font></font>	3</p>
	<p style="margin-left: 0.39in; margin-bottom: 0in;"><font face="DejaVu Sans"><font size="3">工程结构截图</font></font>	5</p>
	<p style="margin-left: 0.39in; margin-bottom: 0in;"><font face="DejaVu Sans"><font size="3">测试与打包</font></font>	5</p>
	<p style="margin-left: 0.39in; margin-bottom: 0in;"><font face="DejaVu Sans"><font size="3">启用定制后的登录验证</font></font>	6</p>
	<p style="margin-left: 0.39in; margin-bottom: 0in;"><font face="DejaVu Sans"><font size="3">整合测试</font></font>	7</p>
	<p style="margin-left: 0.2in; margin-bottom: 0in;"><font face="DejaVu Sans"><font size="3">总结</font></font><font size="4">	7</font></p>
</div>
<p><br><br>
</p>
<h2 class="western" id="toc_h2_0"><font face="DejaVu Sans">摘要</font></h2>
<p><font face="DejaVu Sans">本文以</font><font face="Microsoft YaHei">Liferay</font><font face="DejaVu Sans">与</font><font face="Microsoft YaHei">CAS</font><font face="DejaVu Sans">整合为例，将</font><font face="Microsoft YaHei">CAS</font><font face="DejaVu Sans">登录验证从输入相同的用户名</font><font face="Microsoft YaHei">/</font><font face="DejaVu Sans">密码定制为以</font><font face="Microsoft YaHei">Liferay</font><font face="DejaVu Sans">的用户身份进行验证。</font></p>
<p><br><br>
</p>
<h3 class="western" id="toc_h3_1"><font face="DejaVu Sans">环境</font></h3>
<ul><li><p style="margin-bottom: 0in;">MySQL5.0.5</p>
	</li><li><p style="margin-bottom: 0in;">JRE 1.6.0.7</p>
	</li><li><p style="margin-bottom: 0in;"><font face="Microsoft YaHei">Ubuntu
	8.04</font></p>
	</li><li><p style="margin-bottom: 0in;"><a href="http://downloads.sourceforge.net/lportal/liferay-portal-tomcat-6.0-5.1.1.zip" target="_blank">Liferay
	5.1.1 Bundled with Tomcat 6.0</a></p>
	</li><li><p style="margin-bottom: 0in;"><a href="http://www.ja-sig.org/downloads/cas/cas-server-3.3-release.zip" target="_blank"><font face="Microsoft YaHei">CAS
	Server 3.3.1</font></a></p>
	</li><li><p style="margin-bottom: 0in;"><a href="http://www.ja-sig.org/downloads/cas-clients/cas-client-2.0.11.zip" target="_blank"><font face="Microsoft YaHei">Yale
	CAS Client 2.0.11</font></a></p>
	</li><li><p style="margin-bottom: 0in;"><a href="http://www.netbeans.org/" target="_blank"><font face="Microsoft YaHei">NetBeans
	IDE 6.1</font></a></p>
</li></ul>
<p style="margin-bottom: 0in;"><br>
</p>
<p style="margin-bottom: 0in;"><font face="DejaVu Sans"><i><b>在进行本文示例前，请参考</b></i><a href="http://blog.csdn.net/DL88250/archive/2008/08/20/2802525.aspx" target="_blank"><i><b>这里</b></i></a><i><b>。</b></i></font></p>
<p style="margin-bottom: 0in;"><br>
</p>
<h3 class="western" id="toc_h3_2"><a name="DDE_LINK" target="_blank"></a><font face="DejaVu Sans">新建工程</font></h3>
<p><font face="DejaVu Sans">打开</font>NetBeans IDE<font face="DejaVu Sans">，新建</font>Java
Class Library<font face="DejaVu Sans">工程：</font>PortalAuthHandler<font face="DejaVu Sans">。</font></p>
<p><br><br>
</p>
<h3 class="western" id="toc_h3_3"><font face="DejaVu Sans">添加依赖包</font></h3>
<p><font face="DejaVu Sans">从</font>CAS<font face="DejaVu Sans">中的</font>lib<font face="DejaVu Sans">下找到如下</font>jar<font face="DejaVu Sans">：</font></p>
<ul><li><p>cas-server-core-3.3.jar</p>
	</li><li><p>inspektr-core-0.7.0.jar</p>
</li></ul>
<p><font face="DejaVu Sans">下载</font>spring-core.jar(2.5.5)<font face="DejaVu Sans">，点<a href="http://sourceforge.net/project/downloading.php?group_id=73357&amp;use_mirror=osdn&amp;filename=spring-framework-2.5.5.zip&amp;94840949" target="_blank">这里</a>。</font></p>
<p><font face="DejaVu Sans">将这三个</font>jar<font face="DejaVu Sans">包添加到工程</font>PortalAuthHandler<font face="DejaVu Sans">下。</font></p>
<p><br><br>
</p>
<h3 class="western" id="toc_h3_4"><font face="DejaVu Sans">编写测试用例</font></h3>
<p><font face="DejaVu Sans">在</font>Test Packages<font face="DejaVu Sans">下建立测试用例，代码如下：</font></p>
<p><br><br>
</p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">package
com.jinfonet.developer.portal;</font></font></p>
<p><br><br>
</p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">import
junit.framework.TestCase;</font></font></p>
<p><a name="DDE_LINK1" target="_blank"></a><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">import
org.jasig.cas.authentication.handler.PasswordEncoder;</font></font></p>
<p><br><br>
</p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">/**</font></font></p>
<p> <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">*</font></font></p>
<p> <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">*
@author 88250 &lt;DL88250@gmail.com&gt;</font></font></p>
<p> <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">*/</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">public
final class Base64PasswordEncoderTests extends TestCase {</font></font></p>
<p><br><br>
</p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">private
final PasswordEncoder passwordEncoder = new
Base64PasswordEncoder("SHA1");</font></font></p>
<p><br><br>
</p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">public
void testHashBase64Encoded() {</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">assertEquals("qUqP5cyxm6YcTAhz05Hph5gvu9M=",
this.passwordEncoder.encode("test"));</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p><br><br>
</p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">public
void testNullPassword() {</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">assertEquals(null,
this.passwordEncoder.encode(null));</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p><br><br>
</p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">public
void testInvalidEncodingType() {</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">final
PasswordEncoder pe = new Base64PasswordEncoder("invalid
encoding");</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">try
{</font></font></p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">pe.encode("test");</font></font></p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">fail("exception
expected.");</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}
catch (final Exception e) {</font></font></p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">return;</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p><br><br>
</p>
<p><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">这个测试用例有三个测试方法，其中</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">HashBase64Encoded</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">最为重要。因为在</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">Liferay</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">的帐户表</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">User_</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">中的</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">password_</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">字段默认是以</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">SHA1</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">进行加密，然后再以</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">Base64</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">进行编码存放的。而</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">CAS</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">中自带的</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">Password
Encoder</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">只有用加密算法进行加密的步骤，没有</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">Base64</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">编码的步骤，所以我们要写一个带有</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">Base64</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">编码功能的</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">Encoder</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">，且必须是实现
</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2"><font style="font-size: 9pt;" size="2">org.jasig.cas.authentication.handler.PasswordEncoder</font></font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2"><font style="font-size: 9pt;" size="2">接口的。</font></font></font></p>
<p><br><br>
</p>
<h3 class="western" id="toc_h3_5"><font face="DejaVu Sans">编写实现代码</font></h3>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">package
com.jinfonet.developer.portal;</font></font></p>
<p><br><br>
</p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">import
java.io.UnsupportedEncodingException;</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">import
java.security.MessageDigest;</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">import
java.security.NoSuchAlgorithmException;</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">import
org.inspektr.common.ioc.annotation.NotNull;</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">import
org.jasig.cas.authentication.handler.PasswordEncoder;</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">import
org.springframework.util.StringUtils;</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">import
sun.misc.BASE64Encoder;</font></font></p>
<p><br><br>
</p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">/**</font></font></p>
<p> <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">*</font></font></p>
<p> <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">*
@author 88250 &lt;DL88250@gmail.com&gt;</font></font></p>
<p> <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">*/</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">public
class Base64PasswordEncoder implements PasswordEncoder {</font></font></p>
<p><br><br>
</p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">private
static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5',</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">'6',
'7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">};</font></font></p>
<p><br><br>
</p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">@NotNull</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">private
final String encodingAlgorithm;</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">private
String characterEncoding;</font></font></p>
<p><br><br>
</p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">public
Base64PasswordEncoder(final String encodingAlgorithm) {</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">this.encodingAlgorithm
= encodingAlgorithm;</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p><br><br>
</p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">public
String encode(final String password) {</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">if
(password == null) {</font></font></p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">return
null;</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p><br><br>
</p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">try
{</font></font></p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">MessageDigest
messageDigest = MessageDigest.getInstance(this.encodingAlgorithm);</font></font></p>
<p><br><br>
</p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">if
(StringUtils.hasText(this.characterEncoding)) {</font></font></p>
<p>               
<font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">messageDigest.update(password.getBytes(this.characterEncoding));</font></font></p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}
else {</font></font></p>
<p>                <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">messageDigest.update(password.getBytes());</font></font></p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p><br><br>
</p>
<p><br><br>
</p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">final
byte[] digest = messageDigest.digest();</font></font></p>
<p><br><br>
</p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">return
getFormattedText(digest);</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}
catch (final NoSuchAlgorithmException e) {</font></font></p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">throw
new SecurityException(e);</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}
catch (final UnsupportedEncodingException e) {</font></font></p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">throw
new RuntimeException(e);</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p><br><br>
</p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">/**</font></font></p>
<p>     <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">*
Takes the raw bytes from the digest and formats them correct.</font></font></p>
<p>     <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">*
</font></font>
</p>
<p>     <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">*
@param bytes the raw bytes from the digest.</font></font></p>
<p>     <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">*
@return the formatted bytes.</font></font></p>
<p>     <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">*/</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">private
String getFormattedText(byte[] bytes) {</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">final
StringBuilder buf = new StringBuilder(bytes.length * 2);</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">sun.misc.BASE64Encoder
e = new BASE64Encoder();</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">final
String buf2 = e.encode(bytes);</font></font></p>
<p><br><br>
</p>
<p><br><br>
</p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">for
(int j = 0; j &lt; bytes.length; j++) {</font></font></p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">buf.append(HEX_DIGITS[(bytes[j]
&gt;&gt; 4) &amp; 0x0f]);</font></font></p>
<p>            <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">buf.append(HEX_DIGITS[bytes[j]
&amp; 0x0f]);</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p><br><br>
</p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">System.out.println("Final:
" + buf2);</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">System.out.println(encodingAlgorithm
+ ": " + buf);</font></font></p>
<p>        
</p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">return
buf2.toString();</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p><br><br>
</p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">public
final void setCharacterEncoding(final String characterEncoding) {</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">this.characterEncoding
= characterEncoding;</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">}</font></font></p>
<p><br><br>
</p>
<p><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2"><b>注意：</b>这里，我们使用了</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">Sun</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">的一个受限类：</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">BASE64Encoder</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">。如果你自己有实现，尽量用自己的。</font></font></p>
<p><br><br>
</p>
<h3 class="western" id="toc_h3_6"><font face="DejaVu Sans">工程结构截图</font></h3>
<p><font face="DejaVu Sans">工程的完整结构截图如下：</font></p><p><font face="DejaVu Sans"><br></font></p><div align="center"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/DL88250/273209/o_PortalAuthHandler.png" align=""><br>
</div><p><br><br>
</p>
<h3 class="western" id="toc_h3_7"><font face="DejaVu Sans">测试与打包</font></h3>
<p><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">单元测通过后到工程目录下的</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">dist</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">目录下把</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">Build</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">出的</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">jar</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">中的</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">class</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">文件</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">(with
package)</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">打包到</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">$LIFERAY_HOME/webapps/cas-web/cas-server-core-3.3.jar</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">中。</font></font></p>
<p><br><br>
</p>
<h3 class="western" id="toc_h3_8"><font face="DejaVu Sans">启用定制后的登录验证</font></h3>
<p><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">编辑</font></font><font face="Courier 10 Pitch"><font style="font-size: 10pt;" size="2">$LIFERAY_HOME/webapps/cas-web/WEB-INF/deployerConfigContext.xml</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">文件，将</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;bean&nbsp;class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler"&nbsp;/&gt;</font></font></p>
<p><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">替换为</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;bean
class="org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler"&gt;
</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;property
name="sql" value="select password_ from User_ where
</font></font><font color="#ff0000"><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">screenName</font></font></font><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">=?"/&gt;
</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;property
name="passwordEncoder" ref="base64PasswordEncoder"/&gt;
</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;property
name="dataSource" ref="dataSource"/&gt;
</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;/bean&gt;</font></font></p>
<p><font face="DejaVu Sans"><b><font style="font-size: 9pt;" size="2">注意：</font></b><font style="font-size: 9pt;" size="2"><span style="">在</span></font></font><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2"><span style="">Liferay</span></font></font><font face="DejaVu Sans"><font style="font-size: 9pt;" size="2"><span style="">中最好使用</span></font></font><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2"><span style="">screenName</span></font></font><font face="DejaVu Sans"><font style="font-size: 9pt;" size="2"><span style="">作为</span></font></font><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2"><span style="">CAS</span></font></font><font face="DejaVu Sans"><font style="font-size: 9pt;" size="2"><span style="">验证的用户名，</span></font></font><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2"><span style="">emailAddress</span></font></font><font face="DejaVu Sans"><font style="font-size: 9pt;" size="2"><span style="">是不能用的，</span></font></font><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2"><span style="">ID</span></font></font><font face="DejaVu Sans"><font style="font-size: 9pt;" size="2"><span style="">方式没经过测试。</span></font></font></p>
<p><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">然后，在紧跟的</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">			&lt;/list&gt;
</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">		&lt;/property&gt;
</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">	&lt;/bean&gt;</font></font></p>
<p><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">后加入：</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;bean
id="dataSource"
</font></font></p>
<p>       
<font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;property
name="driverClassName" value="${db.driver}" /&gt;
</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;property
name="url" value="${db.url}" /&gt;
</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;property
name="username" value="${db.username}" /&gt;
</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;property
name="password" value="${db.password}" /&gt;
</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;/bean&gt;
</font></font></p>
<p><font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">
</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;bean
id="base64PasswordEncoder"
</font></font></p>
<p>       
<font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">class="com.jinfonet.developer.portal.Base64PasswordEncoder"
autowire="byName"&gt;
</font></font></p>
<p>        <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;constructor-arg
value="SHA1" /&gt;
</font></font></p>
<p>    <font face="Courier 10 Pitch"><font style="font-size: 9pt;" size="2">&lt;/bean&gt;</font></font></p>
<p><br><br>
</p>
<p><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">最后，修改在文件</font></font><font style="font-size: 10pt;" size="2"><font face="Courier 10 Pitch">$LIFERAY_HOME/webapps/cas-web/WEB-INF/cas.properties</font></font><font face="DejaVu Sans"><font style="font-size: 10pt;" size="2">中配置一下数据库连接，如下：</font></font></p>
<p><br><br>
</p>
<p><font style="font-size: 9pt;" size="2"><font face="Courier 10 Pitch">#database.hibernate.dialect=org.hibernate.dialect.OracleDialect
</font></font></p>
<p><font style="font-size: 9pt;" size="2"><font face="Courier 10 Pitch">database.hibernate.dialect=org.hibernate.dialect.MySQLDialect
</font></font></p>
<p><font style="font-size: 9pt;" size="2"><font face="Courier 10 Pitch">#database.hibernate.dialect=org.hibernate.dialect.HSQLDialect</font></font></p>
<p><br><br>
</p>
<p><font style="font-size: 9pt;" size="2"><font face="Courier 10 Pitch">db.driver=com.mysql.jdbc.Driver</font></font></p>
<p><font style="font-size: 9pt;" size="2"><font face="Courier 10 Pitch">db.url=jdbc:mysql://localhost:3306/lportal?useUnicode=true&amp;amp;characterEncoding=UTF-8&amp;amp;useFastDateParsing=false</font></font></p>
<p><font style="font-size: 9pt;" size="2"><font face="Courier 10 Pitch">db.username=lportal</font></font></p>
<p><font style="font-size: 9pt;" size="2"><font face="Courier 10 Pitch">db.password=dl88250</font></font></p>
<p><br><br>
</p>
<h3 class="western" id="toc_h3_9"><font face="DejaVu Sans">整合测试</font></h3>
<p><font face="DejaVu Sans">启动</font><font face="Courier 10 Pitch">Liferay</font><font face="DejaVu Sans">与</font><font face="Courier 10 Pitch">CAS</font><font face="DejaVu Sans">后，登录</font><font face="Courier 10 Pitch">Liferay(</font><font face="DejaVu Sans">使用非</font><font face="Courier 10 Pitch">Portlet)</font><font face="DejaVu Sans">时将自动跳转到</font><font face="Courier 10 Pitch">CAS</font><font face="DejaVu Sans">验证页面，输入用户名</font><font face="Courier 10 Pitch">(your
screen name)</font><font face="DejaVu Sans">与密码后，如果登录成功，将自动跳转到你在</font><font face="Courier 10 Pitch">Liferay</font><font face="DejaVu Sans">的</font><font face="Courier 10 Pitch">Home</font><font face="DejaVu Sans">里。</font></p>
<p><br><br>
</p>
<h2 class="western" id="toc_h2_10"><font face="DejaVu Sans">总结</font></h2>
<p><font face="DejaVu Sans">本文以</font><font face="Courier 10 Pitch">CAS</font><font face="DejaVu Sans">与</font><font face="Courier 10 Pitch">Liferay</font><font face="DejaVu Sans">的整合为例，介绍了定制</font><font face="Courier 10 Pitch">CAS</font><font face="DejaVu Sans">登录验证的整个开发与配置过程，也强调了一些需要注意的地方。使用</font><font face="Courier 10 Pitch">CAS</font><font face="DejaVu Sans">实现</font><font face="Courier 10 Pitch">SSO(Single
Sign On)</font><font face="DejaVu Sans">将在下一次的文章中介绍，将以</font><font face="Courier 10 Pitch">CAS</font><font face="DejaVu Sans">整合</font><font face="Courier 10 Pitch">Liferay+Scarab</font><font face="DejaVu Sans">为例给大家介绍，请大家多多给予关注哦
</font><font face="Courier 10 Pitch">: )</font></p>
                    <div>
                        <br>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- D博客文章签名档 -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-5357405790190342"
     data-ad-slot="7757575754"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
                    </div>
            </section>
        </div>

    </div>
        <div class="post__toc">
<ul class="article__toc">
        <li class="toc__h2">
            <a href="#toc_h2_0">摘要</a>
        </li>
        <li class="toc__h3">
            <a href="#toc_h3_1">环境</a>
        </li>
        <li class="toc__h3">
            <a href="#toc_h3_2">新建工程</a>
        </li>
        <li class="toc__h3">
            <a href="#toc_h3_3">添加依赖包</a>
        </li>
        <li class="toc__h3">
            <a href="#toc_h3_4">编写测试用例</a>
        </li>
        <li class="toc__h3">
            <a href="#toc_h3_5">编写实现代码</a>
        </li>
        <li class="toc__h3">
            <a href="#toc_h3_6">工程结构截图</a>
        </li>
        <li class="toc__h3">
            <a href="#toc_h3_7">测试与打包</a>
        </li>
        <li class="toc__h3">
            <a href="#toc_h3_8">启用定制后的登录验证</a>
        </li>
        <li class="toc__h3">
            <a href="#toc_h3_9">整合测试</a>
        </li>
        <li class="toc__h2">
            <a href="#toc_h2_10">总结</a>
        </li>
</ul>        </div>
        <div id="b3logsolocomments"></div>
        <div class="wrapper">
            <div id="vcomment"
                 style="    margin-bottom: 40px; margin-top: 80px;
        border: 1px solid rgba(255,255,255,0.8);
        border-radius: 5px;
        background: rgba(255,255,255,0.9);
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
        padding: 20px;"
                 data-name="88250" data-postId="1219750620000"></div>
        </div>
    <div class="article__bottom">
        <div class="wrapper">
            <div class="fn__flex">
                    <div class="item" id="externalRelevantArticles"></div>
                <div class="item" id="randomArticles"></div>
                <div class="item" id="relevantArticles"></div>
            </div>
        </div>
    </div>
    
</div>
<script type="text/javascript"
        src="https://cdn.jsdelivr.net/gh/88250/solo@4.2.0/src/main/resources/skins/Bubble/js/TweenMax.min.js?1593357893538"
        charset="utf-8"></script>
<footer class="footer">
    <div class="wrapper">
            <a href="https://hacpai.com/member/88250"
       title="https://hacpai.com/member/88250"
       class="user__site"
       target="_blank" rel="noopener nofollow">
        <svg viewBox="0 0 32 32" width="100%" height="100%">
            <path fill="#d23f31" style="fill: var(--color1, #d23f31)" d="M5.787 17.226h17.033l5.954 9.528c0.47 0.752 0.003 1.361-1.042 1.361h-15.141z"></path>
            <path d="M10.74 3.927h17.033c1.045 0 1.512 0.609 1.042 1.361l-5.954 9.528h-19.872l6.379-10.209c0.235-0.376 0.849-0.681 1.372-0.681z"></path>
            <path d="M2.953 17.226h2.839l6.804 10.889h-1.892c-0.523 0-1.137-0.305-1.372-0.681z"></path>
        </svg>
    </a>

        <a href="https://github.com/88250"
           title="https://github.com/88250"
           class="user__site"
           target="_blank" rel="noopener nofollow">
            <svg viewBox="0 0 32 32" width="100%" height="100%">
                <path d="M16 0.331c-8.836 0-16 7.163-16 16 0 7.069 4.585 13.067 10.942 15.182 0.8 0.148 1.094-0.347 1.094-0.77 0-0.381-0.015-1.642-0.022-2.979-4.452 0.968-5.391-1.888-5.391-1.888-0.728-1.849-1.776-2.341-1.776-2.341-1.452-0.993 0.11-0.973 0.11-0.973 1.606 0.113 2.452 1.649 2.452 1.649 1.427 2.446 3.743 1.739 4.656 1.33 0.143-1.034 0.558-1.74 1.016-2.14-3.554-0.404-7.29-1.777-7.29-7.907 0-1.747 0.625-3.174 1.649-4.295-0.166-0.403-0.714-2.030 0.155-4.234 0 0 1.344-0.43 4.401 1.64 1.276-0.355 2.645-0.532 4.005-0.539 1.359 0.006 2.729 0.184 4.008 0.539 3.054-2.070 4.395-1.64 4.395-1.64 0.871 2.204 0.323 3.831 0.157 4.234 1.026 1.12 1.647 2.548 1.647 4.295 0 6.145-3.743 7.498-7.306 7.895 0.574 0.497 1.085 1.47 1.085 2.963 0 2.141-0.019 3.864-0.019 4.391 0 0.426 0.288 0.925 1.099 0.768 6.354-2.118 10.933-8.113 10.933-15.18 0-8.837-7.164-16-16-16z"></path>
            </svg>
        </a>

 <br>
        &copy; 2020
        <a href="https://dl88250.gitee.io">D 的个人博客</a>
        
        <span class="footer__heart">❤️</span>
    </div>
</footer>
<svg class="side__top" id="sideTop" version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
    <path d="M26.562 13.958c0 0.72 0.583 1.303 1.303 1.303s1.303-0.583 1.303-1.303v0c0-0.72-0.583-1.303-1.303-1.303s-1.303 0.583-1.303 1.303v0zM23.305 10.7c0 0 0 0 0 0 0 0.72 0.583 1.303 1.303 1.303s1.303-0.583 1.303-1.303c0-0 0-0 0-0v0c0-0 0-0 0-0 0-0.72-0.583-1.303-1.303-1.303s-1.303 0.583-1.303 1.303c0 0 0 0 0 0v0zM20.022 7.417c0 0 0 0 0 0 0 0.72 0.583 1.303 1.303 1.303s1.303-0.583 1.303-1.303c0-0 0-0 0-0v0c0-0 0-0 0-0 0-0.72-0.583-1.303-1.303-1.303s-1.303 0.583-1.303 1.303c0 0 0 0 0 0v0zM29.67 0h-27.339c-0.677 0-1.228 0.551-1.228 1.228s0.551 1.228 1.228 1.228h11.151l-10.725 10.725c-0.476 0.476-0.476 1.253 0 1.729 0.226 0.226 0.551 0.351 0.852 0.351s0.626-0.125 0.852-0.351l10.074-10.074v25.936c0 0.677 0.551 1.228 1.228 1.228s1.228-0.551 1.228-1.228v-26.011c0.476 0.426 1.203 0.426 1.679-0.050s0.476-1.253 0-1.729l-0.576-0.576h11.577c0.677 0 1.228-0.551 1.228-1.228 0-0.626-0.551-1.178-1.228-1.178z"></path>
</svg>
<script>
  var Label = {
    speech: true,
    servePath: "https://dl88250.gitee.io",
    staticServePath: "https://cdn.jsdelivr.net/gh/88250/solo@4.2.0/src/main/resources",
    luteAvailable: true,
    hljsStyle: 'monokai',
    langLabel: "zh_CN",
    version: "4.2.0",
    staticSite: true,
    showCodeBlockLn: true,
  }
</script>
<script type="text/javascript"
        src="https://cdn.jsdelivr.net/gh/88250/solo@4.2.0/src/main/resources/skins/Bubble/js/common.min.js?1593357893538"
        charset="utf-8"></script>
<script type="text/javascript"
        src="https://cdn.jsdelivr.net/gh/88250/solo@4.2.0/src/main/resources/skins/Bubble/js/circleMagic.min.js?1593357893538"
        charset="utf-8"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/kanbanniang@0.2.8/index.css"/>
<script async src="https://cdn.jsdelivr.net/npm/kanbanniang@0.2.8/index.js"></script>
<div class="solo-kanbanniang">
    <div class="solo-kanbanniang__tip"></div>
    <canvas id="soloKanbanniang" width="280" height="250"></canvas>
    <div class="solo-kanbanniang__tool">
        <svg id="soloKanbanniangHome" viewBox="0 0 32 32" width="100%" height="100%">
            <path d="M32 18.967l-16-12.42-16 12.42v-5.064l16-12.42 16 12.42zM28 18.516v12h-8v-8h-8v8h-8v-12l12-9z"></path>
        </svg>
        <svg id="soloKanbanniangRSS" viewBox="0 0 1024 1024" width="32" height="32">
            <path d="M320.364 768q0 45.728-32 77.728t-77.728 32-77.728-32-32-77.728 32-77.728 77.728-32 77.728 32 32 77.728zM612.94 838.272q1.152 16-9.728 27.424-10.272 12-26.848 12h-77.152q-14.272 0-24.576-9.44t-11.424-23.712q-12.576-130.848-105.44-223.712t-223.712-105.44q-14.272-1.152-23.712-11.424t-9.44-24.576V402.24q0-16.576 12-26.848 9.728-9.728 24.576-9.728h2.848q91.424 7.424 174.848 46.016t148 103.712q65.152 64.576 103.712 148t46.016 174.848z m292.576 1.152q1.152 15.424-10.272 26.848-10.272 11.424-26.272 11.424h-81.728q-14.848 0-25.44-10.016t-11.136-24.288q-6.848-122.848-57.728-233.44t-132.288-192-192-132.288-233.44-58.272q-14.272-0.576-24.288-11.136t-10.016-24.864V109.664q0-16 11.424-26.272 10.272-10.272 25.152-10.272h1.728q149.728 7.424 286.56 68.576t243.136 168q106.848 106.272 168 243.136t68.576 286.56z"></path>
        </svg>
        <svg id="soloKanbanniangChat" viewBox="0 0 1024 1024" width="32" height="32">
            <path d="M802.42709 96.163153H219.476155c-84.48109 0-154.896836 71.746044-154.896836 157.840888v393.119449c0 86.072331 70.415746 157.819398 154.896836 157.819399h214.038818V925.470963s22.526039 40.168862 64.767096 5.734608c30.965246-25.819039 126.721123-91.828428 171.775248-123.385145h132.369773c84.502579 0 154.896836-83.21526 154.896836-157.839865V251.125481c0-86.094844-70.394257-154.962328-154.896836-154.962328zM301.144176 518.002714c-39.427988 0-70.416769-31.576159-70.416769-71.746044 0-40.168862 30.988782-71.746044 70.416769-71.746044 39.426965 0 70.393233 31.577183 70.393234 71.746044 0 40.169885-30.966269 71.746044-70.393234 71.746044z m208.411657 0c-39.450501 0-70.415746-31.576159-70.415746-71.746044 0-40.168862 30.965246-71.746044 70.415746-71.746044 39.405475 0 70.394257 31.577183 70.394257 71.746044 0 40.169885-30.988782 71.746044-70.394257 71.746044z m211.203236 0c-39.426965 0-70.416769-31.576159-70.416769-71.746044 0-40.168862 30.988782-71.746044 70.416769-71.746044s70.415746 31.577183 70.415746 71.746044c-0.001023 40.169885-30.988782 71.746044-70.415746 71.746044z"></path>
        </svg>
        <svg id="soloKanbanniangChange" viewBox="0 0 1024 1024" width="32" height="32">
            <path d="M936.672 193.216l-226.88-64c-8.704-2.528-18.112-1.12-25.824 3.776-7.68 4.864-12.896 12.736-14.432 21.728C655.712 236.928 595.328 288 512 288c-71.424 0-142.464-103.296-163.776-143.104-7.136-13.28-22.528-19.84-37.024-15.68l-224 64C73.472 197.152 64 209.728 64 224v256a31.93 31.93 0 0 0 11.712 24.736c7.392 6.08 17.152 8.512 26.56 6.624L224 487.04V832c0 52.928 43.072 96 96 96h384c52.928 0 96-43.072 96-96V519.04l121.728 24.352c9.44 1.92 19.2-0.544 26.56-6.624C955.68 530.656 960 521.6 960 512V224c0-14.336-9.536-26.912-23.328-30.784zM672 800H352c-17.664 0-32-14.304-32-32s14.336-32 32-32h320c17.696 0 32 14.304 32 32s-14.304 32-32 32z"></path>
        </svg>
        <svg id="soloKanbanniangPhoto" viewBox="0 0 1024 1024" width="32" height="32">
            <path d="M898.048 258.048q23.552-1.024 46.592 9.216t40.96 27.136 28.672 39.424 10.752 46.08l0 390.144q0 24.576-10.752 47.104t-28.672 40.448-40.96 28.16-47.616 10.24l-697.344 0q-24.576 0-48.64-10.24t-42.496-27.648-29.696-40.448-11.264-48.64l0-381.952q0-22.528 10.752-45.568t28.672-41.472 39.936-30.208 44.544-11.776l63.488 0 13.312-83.968q3.072-20.48 18.432-32.768t34.816-12.288l456.704 0q19.456 0 34.304 10.752t16.896 34.304l14.336 83.968 54.272 0zM548.864 712.704q40.96 0 77.824-15.872t63.488-42.496 42.496-62.976 15.872-77.312-15.872-77.312-42.496-62.976-63.488-42.496-77.824-15.872-77.312 15.872-63.488 42.496-43.008 62.976-15.872 77.312 15.872 77.312 43.008 62.976 63.488 42.496 77.312 15.872z"></path>
        </svg>
        <svg id="soloKanbanniangGithub" viewBox="0 0 1024 1024" width="32" height="32">
            <path d="M1024 524.8c0 114.346667-32.554667 217.216-97.706667 308.565333-65.066667 91.306667-149.162667 154.538667-252.288 189.610667-11.989333 2.304-20.778667 0.682667-26.325333-4.778667a27.605333 27.605333 0 0 1-8.362667-20.48v-144.213333c0-44.16-11.52-76.501333-34.645333-97.024 25.344-2.730667 48.085333-6.826667 68.309333-12.288a268.629333 268.629333 0 0 0 62.72-26.666667 187.434667 187.434667 0 0 0 53.973334-45.44c14.421333-18.005333 26.197333-41.898667 35.328-71.765333 9.088-29.824 13.653333-64.128 13.653333-102.826667 0-55.125333-17.536-102.058667-52.650667-140.8 16.426667-41.429333 14.677333-87.893333-5.333333-139.392-12.458667-4.096-30.464-1.578667-54.016 7.509334a355.328 355.328 0 0 0-61.312 30.08L640 271.274667a462.336 462.336 0 0 0-128-17.749334c-43.989333 0-86.656 5.930667-128 17.749334a589.824 589.824 0 0 0-28.330667-18.432c-11.776-7.253333-30.336-16.042667-55.68-26.325334-25.344-10.24-44.416-13.312-57.301333-9.216-19.584 51.498667-21.12 97.962667-4.693333 139.434667-35.114667 38.698667-52.650667 85.632-52.650667 140.757333 0 38.698667 4.565333 72.874667 13.653333 102.485334 9.130667 29.610667 20.778667 53.546667 34.986667 71.765333 14.250667 18.218667 32.128 33.493333 53.674667 45.781333 21.546667 12.288 42.453333 21.205333 62.677333 26.666667 20.224 5.461333 43.008 9.557333 68.309333 12.288-17.749333 16.384-28.629333 39.850667-32.64 70.4a130.005333 130.005333 0 0 1-29.994666 10.24c-10.666667 2.261333-23.338667 3.413333-37.973334 3.413333-14.72 0-29.269333-4.906667-43.690666-14.677333-14.464-9.813333-26.794667-24.064-36.992-42.709333a109.226667 109.226667 0 0 0-32.341334-35.541334c-13.141333-9.130667-24.106667-14.592-33.024-16.426666l-13.312-2.048c-9.344 0-15.786667 1.024-19.328 3.072-3.584 2.090667-4.693333 4.693333-3.328 7.893333 1.28 3.157333 3.328 6.4 5.973334 9.557333 2.688 3.2 5.546667 5.930667 8.661333 8.192l4.693333 3.413334c9.770667 4.565333 19.413333 13.226667 29.013334 25.984 9.514667 12.757333 16.512 24.362667 20.992 34.858666l6.656 15.701334c5.76 17.322667 15.530667 31.317333 29.312 42.026666 13.781333 10.666667 28.672 17.536 44.672 20.48 16 2.986667 31.445333 4.565333 46.336 4.821334 14.890667 0.213333 27.221333-0.597333 36.992-2.389334l15.36-2.730666c0 17.28 0.085333 37.546667 0.298666 60.8l0.341334 36.906666a27.050667 27.050667 0 0 1-8.661334 20.48c-5.76 5.461333-14.677333 7.082667-26.666666 4.778667-103.125333-35.072-187.221333-98.261333-252.330667-189.610667C32.554667 742.058667 0 639.146667 0 524.8c0-95.232 22.869333-183.04 68.693333-263.466667A516.266667 516.266667 0 0 1 254.976 70.4C333.44 23.466667 419.114667 0 512 0c92.885333 0 178.56 23.466667 256.981333 70.4a516.266667 516.266667 0 0 1 186.368 190.976C1001.130667 341.802667 1024 429.653333 1024 524.842667z"></path>
        </svg>
        <svg id="soloKanbanniangClose" viewBox="0 0 1024 1024" width="32" height="32">
            <path d="M517.572566143763 1018.6748601482986C238.26554897656422 1018.6748601482986 11.897910175114305 792.2714997690043 11.897910175114305 513.0002041796496c0-279.3070171671984 226.36763880144977-505.71037754649296 505.6746559686481-505.71037754649296 279.2712955893538 0 505.6746559686481 226.40336037929444 505.6746559686481 505.71037754649296C1023.2472221124112 792.2714997690043 796.8795833109612 1018.6748601482986 517.572566143763 1018.6748601482986zM754.7281214542927 339.25044954334646c13.752807470184345-13.752807470184345 9.680547595895998-40.186775075214015-9.073280772537204-58.94060344364717l-2.143294670678079-2.1075730928334457c-18.7538283684332-18.7538283684332-45.15207439561819-22.861809820566194-58.90488186580257-9.073280772537204l-168.21291007038468 168.24863164822932-180.42968969324974-180.46541127109438c-13.967136937252159-13.967136937252159-40.72259874288353-9.823433907274534-59.72647815622916 9.216167083915742l-2.143294670678079 2.143294670678079c-19.039600991190277 19.003879413345654-23.111860865478626 45.75934121897699-9.180445506071107 59.655035000539876l180.42968969324974 180.46541127109438-176.07165719620428 176.03593561835962c-13.788529048028984 13.824250625873615-9.716269173740633 40.151053497369375 9.073280772537204 58.94060344364717l2.1075730928334457 2.1075730928334457c18.7538283684332 18.7538283684332 45.15207439561819 22.897531398410823 58.90488186580257 9.073280772537204l176.10737877404887-176.10737877404887 170.39192631890742 170.42764789675192c13.967136937252159 13.931415359407513 40.686877165038865 9.85915548511917 59.690756578384516-9.180445506071107l2.1790162485227142-2.1790162485227142c19.039600991190277-18.968157835501014 23.147582443323273-45.72361964113239 9.180445506071107-59.690756578384516l-170.39192631890742-170.42764789675192L754.7281214542927 339.25044954334646z"></path>
        </svg>
    </div>
</div>

    <svg viewBox="0 0 32 32" width="100%" height="100%" class="side__top side__top--toc">
        <path d="M30 18h-28c-1.1 0-2-0.9-2-2s0.9-2 2-2h28c1.1 0 2 0.9 2 2s-0.9 2-2 2zM30 6.25h-28c-1.1 0-2-0.9-2-2s0.9-2 2-2h28c1.1 0 2 0.9 2 2s-0.9 2-2 2zM2 25.75h28c1.1 0 2 0.9 2 2s-0.9 2-2 2h-28c-1.1 0-2-0.9-2-2s0.9-2 2-2z"></path>
    </svg>

<script type="text/javascript">
    Util.addScript('https://cdn.jsdelivr.net/gh/88250/solo@4.2.0/src/main/resources/js/page.min.js?1593357893538', 'soloPageScript')
    var page = new Page({
        "commentContentCannotEmptyLabel": "评论内容只能为 2 到 500 个字符！",
        "oId": "1219750620000",
        "blogHost": "https://dl88250.gitee.io",
        "randomArticles1Label": "随机阅读：",
        "externalRelevantArticles1Label": "站外相关阅读："
    });
    $(document).ready(function () {
        page.load();
    page.tips.externalRelevantArticlesDisplayCount = "7";
        page.loadRandomArticles('<h3>随机阅读</h3>');
        page.loadExternalRelevantArticles("Network Engineering,Open Source,Portal &amp; Portlet,J2EE/JavaEE",
        '<h3>站外相关阅读</h3>');
        page.loadRelevantArticles('1219750620000', '<h3>相关阅读</h3>');
    Skin.initArticle()
    });
</script>

</body>
</html>

<!-- Generated by Latke (https://github.com/88250/latke) in 200ms, 2020/06/28 23:27:05 -->